// 区域奖池限制
export const activitySubType = {
  Turntable: { name: "大转盘", max: 10 },
  Flop: { name: "翻牌" },
  BlindBox: { name: "盲盒" },
  HitEgg: { name: "砸金蛋" },
  Jiugongge: { name: "九宫格", min: 8, max: 8 },
  SlotMachine: { name: "老虎机", min: 2 },
  RedEnvelope: { name: "开红包" },
  Scratch: { name: "刮刮乐" },
  Shake: { name: "摇一摇" },
  Gashapon: { name: "扭蛋机" },
  GoodsGroup: { name: "商品组", min: 1 },
  Goods: { name: "商品", min: 1, max: 1 },
  Seckill: { name: "秒杀", min: 1, max: 10 },
  TurntableGroup: { name: "大转盘", max: 10 },
  FlopGroup: { name: "翻牌" },
  BlindBoxGroup: { name: "盲盒" },
  HitEggGroup: { name: "砸金蛋" },
  JiugonggeGroup: { name: "九宫格", min: 8, max: 8 },
  SlotMachineGroup: { name: "老虎机", min: 2 },
  RedEnvelopeGroup: { name: "开红包" },
  ScratchGroup: { name: "刮刮乐" },
  ShakeGroup: { name: "摇一摇" },
  GashaponGroup: { name: "扭蛋机" },
  GoodsGroupGroup: { name: "商品组", min: 1 },
  GoodsGroup: { name: "商品", min: 1, max: 1 },
  SeckillGroup: { name: "秒杀", min: 1, max: 10 },
  GoodsSpecGroup: { name: "商品规格组", min: 1 },
};

// 页面区域类型及奖池类型
export const zoonType = {
  BlindBox: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  Flop: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  HitEgg: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  Jiugongge: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, min: 8, max: 8, name: "抽奖奖池", defaulted: 1 }],
  },
  Scratch: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  Gashapon: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  Turntable: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, max: 10, name: "抽奖奖池", defaulted: 1 }],
  },
  SlotMachine: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, min: 2, name: "抽奖奖池", defaulted: 1 }],
  },
  Shake: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  RedEnvelope: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  BlindBoxGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  FlopGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  HitEggGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  JiugonggeGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, min: 8, max: 8, name: "抽奖奖池", defaulted: 1 }],
  },
  ScratchGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  GashaponGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  TurntableGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, max: 10, name: "抽奖奖池", defaulted: 1 }],
  },
  SlotMachineGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, min: 2, name: "抽奖奖池", defaulted: 1 }],
  },
  ShakeGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  RedEnvelopeGroup: {
    name: "抽奖配置",
    type: 1,
    prizePool: [{ type: 1, name: "抽奖奖池", defaulted: 1 }],
  },
  GoodsGroup: {
    name: "特卖配置",
    type: 2,
    prizePool: [{ type: 2, min: 1, name: "商品池", defaulted: 1 }],
  },
  GoodsSpecGroup: {
    name: "特卖配置",
    type: 2,
    prizePool: [{ type: 2, min: 1, name: "商品池", defaulted: 1 }],
  },
  Goods: {
    name: "特卖配置",
    type: 2,
    prizePool: [{ type: 2, min: 1, max: 1, name: "商品池", defaulted: 1 }],
  },
  WeekSign: {
    name: "签到配置",
    type: 3,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  MonthSign: {
    name: "签到配置",
    type: 3,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  TeamUp: {
    name: "裂变配置",
    type: 4,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  FissionBtn: {
    name: "裂变配置",
    type: 4,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  Answer: {
    name: "答题配置",
    type: 5,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  TaskCard: {
    name: "任务配置",
    type: 6,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  ToSignUp: {
    name: "报名配置",
    type: 7,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
  Seckill: {
    name: "秒杀配置",
    type: 8,
    prizePool: [{ type: 2, min: 1, name: "商品池", defaulted: 1 }],
  },
  VoteOnly: {
    name: "投票配置",
    type: 9,
    prizePool: [
      { type: 2, name: "商品池", defaulted: 0 },
      { type: 1, min: 1, name: "抽奖奖池", defaulted: 0 },
    ],
  },
};

// 基础组件
export const basicComponents = [
  {
    name: "基础组件",
    components: [
      {
        name: "图片",
        type: "Image",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "富文本",
        type: "RichText",
        icon: "./imagesStatic/activity/component_richtext.png",
        zone: false,
      },
      {
        name: "按钮",
        type: "BButton",
        icon: "./imagesStatic/activity/component_button.png",
        zone: false,
      },
    ],
  },
];
// 登录组件
export const loginComponents = [
  {
    name: "登录组件",
    components: [
      {
        name: "抽奖机会",
        type: "LotteryChance",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "奖池",
        type: "PrizePool",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "中奖公告",
        type: "Announcement",
        icon: "./imagesStatic/activity/component_swiper.png",
        zone: false,
      },
    ],
  },
  ...basicComponents,
];

// 抽奖组组件
export const lotteryComponents = [
  {
    name: "个性化组件",
    components: [
      {
        name: "抽奖机会",
        type: "LotteryChance",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "奖池",
        type: "PrizePool",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "中奖公告",
        type: "Announcement",
        icon: "./imagesStatic/activity/component_swiper.png",
        zone: false,
      },
    ],
  },
  ...basicComponents,
];

// 自定义弹窗组组件
export const popupComponentList = [
  {
    name: "个性化组件",
    components: [
      {
        name: "立即领奖",
        type: "PrizeReceive",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "得分",
        type: "Score",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
    ],
  },
  ...basicComponents,
];

// 活动模板编辑器组件
export const componentList = [
  {
    name: "基础组件",
    type: 'foundationComps',
    components: [
      {
        name: "图片",
        type: "Image",
        icon: "./imagesStatic/activity/component_image.png",
        zone: false,
      },
      {
        name: "富文本",
        type: "RichText",
        icon: "./imagesStatic/activity/component_richtext.png",
        zone: false,
      },
      {
        name: "按钮",
        type: "BButton",
        icon: "./imagesStatic/activity/component_button.png",
        zone: false,
      },
      {
        name: "积分",
        type: "Integral",
        icon: "./imagesStatic/activity/component_integral.png",
        zone: false,
      },
      {
        name: "基础弹框",
        type: "Popup",
        icon: "./imagesStatic/activity/component_popup.png",
        zone: false,
      },
      {
        name: "自定义弹框",
        type: "CustomPopup",
        icon: "./imagesStatic/activity/component_popup.png",
        zone: false,
        group: true,
        components: popupComponentList,
      },
      {
        name: "跑马灯",
        icon: "./imagesStatic/activity/component_swiper.png",
        zone: false,
      },
      {
        name: "商品",
        type: "Goods",
        icon: "./imagesStatic/activity/component_goods.png",
        zone: true,
      },
      {
        name: "商品组",
        type: "GoodsGroup",
        icon: "./imagesStatic/activity/component_goods.png",
        zone: true,
      },
      {
        name: "自定义组",
        type: "CustomGroup",
        icon: "./imagesStatic/activity/component_goods.png",
        zone: false,
        group: true,
        components: basicComponents,
      },
    ],
  },
  {
    name: "特卖",
    type: 'specialSaleComps',
    components: [
      {
        name: "商品规格组",
        type: "GoodsSpecGroup",
        icon: "./imagesStatic/activity/component_goods.png",
        zone: true,
      },
    ],
  },
  {
    name: "表单组件",
    type: 'formComps',
    components: [
      {
        name: "下拉框",
        type: "SelectBox",
        icon: "./imagesStatic/activity/component_task.png",
        zone: true,
      },
      {
        name: "文本组",
        type: "TextGroup",
        icon: "./imagesStatic/activity/component_monthSign.png",
        zone: true,
      },
      {
        name: "提示按钮",
        type: "TipButton",
        icon: "./imagesStatic/activity/component_weekSign.png",
        zone: true,
      },
      // {
      //   name: "登录",
      //   type: "LoginGroup",
      //   icon: "./imagesStatic/activity/component_weekSign.png",
      //   zone: true,
      //   group: true, //套件/组
      //   components: loginComponents, //套件内可添加组件
      // },

    ],
  },
  {
    name: "抽奖组件",
    type: 'lotteryComps',
    components: [
      {
        name: "开盲盒",
        type: "BlindBoxGroup",
        icon: "./imagesStatic/activity/component_blindBox.png",
        zone: true,
        group: true, //套件/组
        components: lotteryComponents, //套件内可添加组件
      },
      {
        name: "大转盘",
        type: "TurntableGroup",
        icon: "./imagesStatic/activity/component_turntable.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "翻牌",
        type: "FlopGroup",
        icon: "./imagesStatic/activity/component_flop.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "砸金蛋",
        type: "HitEggGroup",
        icon: "./imagesStatic/activity/component_hitEgg.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "九宫格",
        type: "JiugonggeGroup",
        icon: "./imagesStatic/activity/component_jiugongge.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "老虎机",
        type: "SlotMachineGroup",
        icon: "./imagesStatic/activity/component_slotMachine.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "开红包",
        type: "RedEnvelopeGroup",
        icon: "./imagesStatic/activity/component_redEnvelope.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "刮刮乐",
        type: "ScratchGroup",
        icon: "./imagesStatic/activity/component_scratch.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "摇一摇",
        type: "ShakeGroup",
        icon: "./imagesStatic/activity/component_shake.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
      {
        name: "扭蛋机",
        type: "GashaponGroup",
        icon: "./imagesStatic/activity/component_gashapon.png",
        zone: true,
        group: true,
        components: lotteryComponents,
      },
    ],
  },
  {
    name: "任务组件",
    type: 'taskComps',
    components: [
      {
        name: "任务卡片",
        type: "TaskCard",
        icon: "./imagesStatic/activity/component_task.png",
        zone: true,
      },
      {
        name: "日历签到",
        type: "MonthSign",
        icon: "./imagesStatic/activity/component_monthSign.png",
        zone: true,
      },
      {
        name: "七日内签到",
        type: "WeekSign",
        icon: "./imagesStatic/activity/component_weekSign.png",
        zone: true,
      },
    ],
  },
  {
    name: "互动组件",
    type: 'interactionComps',
    components: [
      {
        name: "组队",
        type: "TeamUp",
        icon: "./imagesStatic/activity/component_teamUp.png",
        zone: true,
      },
      {
        name: "裂变",
        type: "FissionBtn",
        icon: "./imagesStatic/activity/component_teamUp.png",
        zone: true,
      },
      {
        name: "答题",
        type: "Answer",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
      },
      {
        name: "猜涨跌",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
      },
      {
        name: "集卡",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
      },
      {
        name: "pk",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
      },
      {
        name: "报名",
        type: "ToSignUp",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
      },
      {
        name: "投票",
        type: "VoteOnly",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
        bottom: true, //置底组件/唯一性校验
      },
      {
        name: "秒杀",
        type: "Seckill",
        icon: "./imagesStatic/activity/component_answer.png",
        zone: true,
      },
    ],
  },
];

// 非活动组件
export const unzoneComponentList = componentList.map((item) => {
  return {
    ...item,
    components: item.components.filter((component) => !component.zone),
  };
});

// 活动页面类型
export const pageTypeList = [
  {
    pageName: "首页",
    pageType: "Home",
    removeable: false,
    components: componentList,
  },
  {
    pageName: "自定义页面",
    pageType: "CustomPage",
    removeable: true,
    components: componentList,
  },
  {
    pageName: "作品详情",
    pageType: "VoteDetail",
    removeable: false,
    components: unzoneComponentList,
  },
  {
    pageName: "投票排行榜",
    pageType: "VoteRank",
    removeable: false,
    components: unzoneComponentList,
  },
  {
    pageName: "登录页",
    pageType: "Login",
    removeable: false,
    components: basicComponents,
  },

];
